package com.programmingeyeclient.popularofficial.contrller;



import com.programmingeyeclient.popularofficial.entity.Official;
import com.programmingeyeclient.popularofficial.service.OfficialService;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * 热门官方控制层
 */
@RestController
@AllArgsConstructor
@CrossOrigin
@Api(value = "热门官方文档", tags = "热门官方文档接口")
public class OfficialController {
    @Autowired
    private OfficialService officialService;

    //查询
    @GetMapping("/Official")
    public List<Official> list(){
        System.out.println("热门官方文档:--------------------"+officialService.AllOff());
        return officialService.AllOff();
    }
}
